package icu.zqyhdm.commonService.controller;

import icu.zqyhdm.commonService.service.CaptchaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description
 * @Author lifu
 * @Date 2021/7/7 21:34
 */
@Api(tags = "生成图片验证码")
@RestController
@RequestMapping(value = "/api/common-service/kaptcha")
public class KaptchaController {

    @Autowired
    private CaptchaService captchaService;

    /**
     * 发送图片验证码
     */
    @ApiOperation(value = "发送图片验证码")
    @GetMapping("/captcha.jpg")
    public void kaptcha(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception{
        captchaService.kaptcha(httpServletRequest,httpServletResponse);
    }
}
